/*
 * @Descripttion: 
 * @Author: 小毅
 * @Date: 2021-11-16 20:01:06
 * @LastEditTime: 2021-11-17 17:41:06
 */

import React from 'react'
import { MyModal } from '../Components/index'


export default class ComponentDemo extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      ModalVisible: false
    }
  }

  ModalParam = () => {
    let { ModalVisible } = this.state
    return {
      title: "测试",
      visible: ModalVisible,
      onOk: () => {
        console.log("确定");
        this.setState({ ModalVisible: false })
      },
      onCancel: () => {
        console.log("删除");
        this.setState({ ModalVisible: false })
      }
    }
  }

  showBtn = () => {
    this.setState({ ModalVisible: true })
  }

  render() {
    const { data } = this.state
    return (
      <div>
        <MyModal  {...this.ModalParam()} />

        <button onClick={this.showBtn}>显示</button>
      </div>
    )
  }
}
